home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
E-Education
/
(c)e8.d64
/
rutherford.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
186 lines
100 REM
110 REM RUTHERFORD'S ALPHA-PARTICLE
120 REM SCATTERING EXPERIMENT (SIM)
130 REM
140 REM D. TRANKNER
150 REM LONDON
160 REM
170 REM7 8 9
180 REM 5 DEMO ALPHA EMISSIONS
190 REM1 2 3
200 REM
210 REM G PLACE GOLD FOIL
220 REM R REMOVE GOLD FOIL
230 REM E EXPERIMENTAL TRIALS
240 REM C CLEARS EXP'T DATA
250 POKE53272,21:PRINT"[147]":GOSUB1910
260 FORI=1TO1000:NEXT
270 PRINT"A COMPUTER ASSISTED SIMULATION"
280 FORI=1TO2500:NEXT
290 PRINT"DO YOU NEED INSTRUCTIONS[146] (Y OR N)?"
300 GETA$:IFA$=""THEN300
310 IFA$="Y"THENGOSUB1560
320 G=0:GOSUB 570
330 REM LABEL THE DIAGRAM
340 PRINT"LEAD BLOCK":PRINT"RADIOACTIVE":PRINT" SOURCE[145][145][145][145][145][145][145][145]"
350 IFA$="Y"THENRETURN
360 GOTO500
370 REM THE THIN GOLD FOIL
380 PRINT""TAB(17)"GOLD FOIL"
390 PRINT""
400 FORI=1TO11
410 IFG=0THENPRINTTAB(21)" ":GOTO430
420 PRINTTAB(21)"[220]"
430 NEXT
440 RETURN
450 GOTO500
460 REM THE ZINC SULFIDE SCREEN
470 PRINT""TAB(30)"SSREEN"
480 PRINTTAB(27)"ZINC SULFIDE"
490 RETURN
500 S=0:GETA$:IFA$=""THEN500
510 IFVAL(A$)>0THENS=VAL(A$):GOSUB650
520 IFA$="C"THENGOSUB1470
530 IFA$="E"THENE=1:GOSUB1220
540 IFA$="G"THENG=1:GOSUB370
550 IFA$="R"THENG=0:GOSUB370
560 GOTO500
570 PRINT"[147]":GOSUB1910
580 PRINT""
590 PRINT" [181]"
600 PRINT" [146] [181] [194]"
610 PRINT" [146] [194]"
620 PRINT" [146] [181] [194]"
630 PRINT" [181]"
640 RETURN
650 REM ALPHA-PARTICLE DISPLAY
660 SC=33250-31744:R=40:C=1:A=0
665 REM 1024-32768 FOR C64
670 REM-CREATE THE ALPHA-PARTICLE RAY-
680 POKESC,87:FORJ=3TO31:IFJ=8THENPOKESC+J-42,78:POKESC+J+38,77
690 PRINT""TAB(J)"[166]"
700 IFJ>21ANDS>0THENGOSUB800
710 NEXTJ:POKESC+30,42:IFS>4ORS<7THENGOSUB470
720 REM -ERASE THE ALPHA-PARTICLE RAY-
730 POKESC,81:FORJ=3TO31:IFJ=8THENPOKESC+J-42,32:POKESC+J+38,32
740 IFJ=21ANDG=1THEN780
750 IFJ>21ANDS>0THENA=1:GOSUB800
760 PRINT""TAB(J)" "
770 IFJ=20ANDG=1THENPOKESC+J-1,92
780 NEXTJ:POKESC+30,66
790 RETURN
800 REM ALPHA-PARTICLE DEFLECTIONS
810 IFG=0THENRETURN
820 ONSGOSUB1150,1010,890,830,830,830,1080,940,840
830 RETURN
840 REM SMALL ANGLE -9 DEFLECTIONS
850 XX=64:YY=42:IFA=1THENXX=32:YY=66
860 POKESC+J-42,XX
870 IFJ=31THENPOKESC-10,YY
880 RETURN
890 REM SMALL ANGLE -3 DEFLECTIONS
900 XX=64:YY=42:IFA=1THENXX=32:YY=66
910 POKESC+J+38,XX
920 IFJ=31THENPOKESC+70,YY
930 RETURN
940 REM LARGE ANGLE -8 DEFLECTIONS
950 XX=78:YY=42:IFA=1THENXX=32:YY=77
960 IFJ>26THENRETURN
970 IFJ=26THENPOKESC-256,77:POKESC-215,77:POKESC-174,77
980 POKESC+J-2-(J-21)*40,XX
990 IFJ=26THENPOKESC-215,YY
1000 RETURN
1010 REM LARGE ANGLE -2 DEFLECTIONS
1020 XX=77:YY=42:IFA=1THENXX=32:YY=78
1030 IFJ>26THENRETURN
1040 IFJ=26THENPOKESC+226,78:POKESC+265,78:POKESC+304,78
1050 POKESC+J-2+(J-21)*40,XX
1060 IFJ=26THENPOKESC+265,YY
1070 RETURN
1080 REM RETURN ANGLE -7 DEFLECTIONS
1090 XX=77:YY=42:IFA=1THENXX=32:YY=78
1100 IFJ>26THENRETURN
1110 IFJ=26THENPOKESC-266,78:POKESC-227,78:POKESC-188,78
1120 POKESC-J-(J-22)*40,XX
1130 IFJ=26THENPOKESC-227,YY
1140 RETURN
1150 REM RETURN ANGLE -1 DEFLECTIONS
1160 XX=78:YY=42:IFA=1THENXX=32:YY=77
1170 IFJ>26THENRETURN
1180 IFJ=26THENPOKESC+212,77:POKESC+253,77:POKESC+294,77
1190 POKESC-J+(J-20)*40,XX
1200 IFJ=26THENPOKESC+253,YY
1210 RETURN
1220 REM -ALPHA-PARTICLE EXP'T ROUTINE-
1230 FORK=1TO10
1240 IFG=0THEN1280
1250 EX%=RND(-RND(0))*100+1
1260 IFEX%<61THENEY%=RND(-RND(0))*2+1:ONEY%GOSUB1300,1310:GOTO1290
1270 IFEX%>84THENEY%=RND(-RND(0))*4+1:ONEY%GOSUB1320,1330,1340,1350:GOTO1290
1280 S=5:GOSUB650:GOSUB1360
1290 NEXTK:RETURN
1300 S=9:GOSUB650:GOSUB1360:RETURN
1310 S=3:GOSUB650:GOSUB1360:RETURN
1320 S=8:GOSUB650:GOSUB1360:RETURN
1330 S=2:GOSUB650:GOSUB1360:RETURN
1340 S=7:GOSUB650:GOSUB1360:RETURN
1350 S=1:GOSUB650:GOSUB1360:RETURN
1360 Z(S)=Z(S)+1:Z(4)=Z(4)+200:Z(5)=Z(4)-Z(9)-Z(3)-Z(8)-Z(2)-Z(7)-Z(1)
1370 FORI=1TO9:Z$(I)=STR$(Z(I))
1380 IFZ$(I)=" 0"THENZ$(I)=""
1390 NEXT
1400 PRINT""TAB(12)Z$(7)TAB(28)Z$(8)
1410 PRINT""TAB(34)Z$(9)
1420 PRINTTAB(33)Z$(5)
1430 PRINTTAB(34)Z$(3)
1440 PRINT""Z$(4)
1450 PRINT""TAB(12)Z$(1)TAB(28)Z$(2)
1460 RETURN
1470 REM -CLEAR EXP'T DATA FROM SCREEN
1480 FORI=1TO9:Z(I)=0:Z$(I)="":NEXT
1490 PRINT""TAB(11)" "TAB(28)" "
1500 PRINT""TAB(34)" "
1510 PRINTTAB(33)" "
1520 PRINTTAB(34)" "
1530 PRINT" "
1540 PRINT""TAB(11)" "TAB(28)" "
1550 RETURN
1560 REM -THE INSTRUCTIONS ROUTINE-
1570 GOSUB320:FORI=1TO1000:NEXT:G=1:GOSUB370:FORI=1TO1000:NEXT
1580 GOSUB650:FORI=1TO1000:NEXT:S=8:GOSUB650:FORI=1TO2000:NEXT
1590 PRINT"[147]":GOSUB1910
1600 PRINT"1) DEMONSTRATION OF THE EFFECT"
1610 PRINT"KEY EFFECT"
1620 PRINT"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
1630 PRINT" 5 CREATE PARTICLE PATH AND ERASE"
1640 PRINT" G PLACES THE GOLD FOIL"
1650 PRINT" R REMOVES THE GOLD FOIL
1660 [153]" ALPHA PARTICLE DEFLECTIONS"
1670 [153]" TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB("
1680 [153]" 9 3 UPPER AND LOWER SMALL ANGLE"
1690 [153]" 8 2 UPPER AND LOWER LARGE ANGLE"
1700 [153]" 7 1 UPPER AND LOWER REVERSE ANGLE"
1710 [153]"PRESS ANY KEY WHEN READY"
1720 [161]A$:[139]A$[178]""[167]1720
1730 [153]"LOAD":[141]1910
1740 [153]"2) THE EXPERIMENT ITSELF"
1750 [153]"KEY EFFECT"
1760 [153]"TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB("
1770 [153]" E THE EXPERIMENT TAKES PLACE."
1780 [153]" EACH FULL BEAM OF PARTICLES"
1790 [153]" REPRESENTS 200 ALPHA PARTICLES."
1800 [153]" THIS OCCURS 10 TIMES, WITH"
1810 [153]" THE FULL BEAM AND ALL DEFLECTIONS"
1820 [153]" TOTALLED AND DISPLAYED."
1830 [153]" IF THE GOLD FOIL IS NOT IN PLACE"
1840 [153]" THEN NO DEFLECTIONS WILL OCCUR."
1850 [153]" PRESSING THE KEY AGAIN WILL REPEAT";
1860 [153]" THE ABOVE, ADDING TO THE TOTALS."
1870 [153]" C THIS CLEARS ALL EXPERIMENTAL DATA"
1880 [153]"PRESS ANY KEY WHEN READY"
1890 [161]A$:[139]A$[178]""[167]1890
1900 [142]
1910 [153]"RUTHERFORD'S ALPHA PARTICLE EXPERIMENT"
1920 [153]"TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB(TAB("
1930 [142]